package com.veo.config;

import com.veo.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration(proxyBeanMethods = false)
public class WebMVConfig implements WebMvcConfigurer {

    //配置自定义拦截器，配置拦截的路径和默认不拦截的路径，静态资源要不拦截
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/","/login","/css/**","/js/**","/images/**","/fonts/**","/druid/**","/sql/**","/user/**");
    }
}
